package com.cheng.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cheng.dao.AreaDao;
import com.cheng.domain.base.Area;
import com.cheng.service.base.AreaService;

@Service
@Transactional
public class AreaServiceImpl implements AreaService {
	@Autowired
	private AreaDao areaDao;

	@Override
	public void delArea(String[] str) {
		for (String string : str) {
			areaDao.delete(string);
		}
	}

	@Override
	public Page<Area> findAllByPage(Pageable pageable,
			Specification<Area> specification) {
		return areaDao.findAll(specification, pageable);
	}

	@Override
	public void saveArea(Area model) {
		areaDao.save(model);
	}

	@Override
	public void saveAreas(List<Area> areas) {
		areaDao.save(areas);
	}

	@Override
	public List<Area> findAllArea() {
		return areaDao.findAll();
	}

	@Override
	public List<Area> getAllArea() {
		return areaDao.findAll();
	}
	
}
